<template>
    <div class="box">
        <van-cell style="padding: 20px 16px;">企业管理员认证</van-cell>
        <van-divider style="margin: 7px 0;" />
        <van-row class="row">
            <van-col span="11">
                <div class="mingz">组织证照</div>
                <div class="shangc">
                    <van-uploader :after-read="afterRead" :max-size="500 * 1024" multiple @oversize="onOversize">
                        <van-button icon="plus" style="height:80px;width:105px;"></van-button>
                    </van-uploader>
                </div>
            </van-col>

            <van-col span="2">
                <el-divider direction="vertical"></el-divider>
            </van-col>
            <van-col class="colee" span="11">
                <img v-if="imageUrl" :src="imageUrl" class="avatar" ref="imgsa" @click="acs">
                <a class="aher" @click="cktp">点击查看</a>
            </van-col>
            <span class="tsxx">可接受格式为：jpg、jpeg、png、gif、图片大小不能超过500k；可以添加水印，但不能遮挡关键信息，例如公司名称、公司证件号。</span>
        </van-row>
        <van-row class="biaodanm">
            <van-form @submit="onSubmit">
                <van-field readonly clickable name="picker" :value="value" v-model="value" label="申报口岸"
                    placeholder="请选择" @click="showPicker = true" />
                <van-popup v-model="showPicker" position="bottom">
                    <van-picker show-toolbar :columns="columns" @confirm="onConfirm" @cancel="showPicker = false">
                        <template #option="option">
                            <div style="display: flex; flex-direction: column; align-items: center;">
                                <div>{{ option.name }}</div>
                            </div>
                        </template>
                    </van-picker>
                </van-popup>
                <van-field v-model="qymc" name="企业名称" label="企业名称" placeholder="请输入企业名称全称"
                    :rules="[{ required: true, message: '请输入企业名称全称' }]" />

                <van-field readonly clickable name="picker" :value="valuea" v-model="valuea" label="企业类型"
                    placeholder="请选择" @click="showPickera = true" />
                <van-popup v-model="showPickera" position="bottom">
                    <van-picker show-toolbar :columns="columnsa" @confirm="onConfirma" @cancel="showPickera = false">
                        <template #option="option">
                            <div style="display: flex; flex-direction: column; align-items: center;">
                                <div>{{ option.name }}</div>
                            </div>
                        </template>
                    </van-picker>
                </van-popup>
                <van-field v-model="qydm" name="机构代码" label="机构代码" placeholder="请输入企业机构代码"
                    :rules="[{ required: true, message: '请输入企业机构代码' }]" />
                <!-- <div style="margin: 16px;">
                    <van-button round block type="info" native-type="submit">提交</van-button>
                </div> -->
            </van-form>
        </van-row>
        <van-row class="row">
            <van-col span="11">
                <div class="mingz">身份证（正面）</div>
                <div class="shangc">
                    <van-uploader :after-read="afterRead2" :max-size="500 * 1024" multiple @oversize="onOversize">
                        <van-button icon="plus" style="height:80px;width:105px;"></van-button>
                    </van-uploader>
                </div>
            </van-col>

            <van-col span="2">
                <el-divider direction="vertical"></el-divider>
            </van-col>
            <van-col class="colee" span="11">
                <img v-if="imageUrl2" :src="imageUrl2" class="avatar" ref="imgsa2" @click="acs">
                <a class="aher" @click="cktp2">点击查看</a>
            </van-col>
            <span class="tsxx">可接受格式为：jpg、jpeg、png、gif、图片大小不能超过500k；可以添加水印，但不能遮挡关键信息，例如名字、身份证号。</span>
        </van-row>
        <van-row class="row">
            <van-col span="11">
                <div class="mingz">身份证（反面）</div>
                <div class="shangc">
                    <van-uploader :after-read="afterRead3" :max-size="500 * 1024" multiple @oversize="onOversize">
                        <van-button icon="plus" style="height:80px;width:105px;"></van-button>
                    </van-uploader>
                </div>
            </van-col>

            <van-col span="2">
                <el-divider direction="vertical"></el-divider>
            </van-col>
            <van-col class="colee" span="11">
                <!-- <img v-if="imageUrl3" :src="imageUrl3" class="avatar" ref="imgsa3" @click="acs"> -->
                <img v-if="imageUrl3" :src="imageUrl3" class="avatar" ref="imgsa3" @click="acs">
                <a class="aher" @click="cktp3">点击查看</a>
            </van-col>
            <span class="tsxx">可接受格式为：jpg、jpeg、png、gif、图片大小不能超过500k；可以添加水印，但不能遮挡关键信息。</span>
        </van-row>
        <van-row class="biaodanm">
            <van-field readonly v-model="xzsxm" name="姓名" label="姓名" placeholder="请输入名字"
                :rules="[{ required: true, message: '请输入名字' }]" />
            <van-field name="radio" label="性别">
                <template #input>
                    <van-radio-group v-model="radio" disabled direction="horizontal">
                        <van-radio name="1">男</van-radio>
                        <van-radio name="2">女</van-radio>
                    </van-radio-group>
                </template>
            </van-field>
            <van-field readonly v-model="xzssfz" name="身份证号码" label="身份证号码" placeholder="请输入身份证号码"
                :rules="[{ required: true, message: '请输入身份证号码' }]" />
            <van-field v-model="sysOrgCode" name="所属部门" label="所属部门" placeholder="请输入所属部门"
                :rules="[{ required: true, message: '请输入所属部门' }]" />
            <van-field v-model="zw" name="职务" label="职务" placeholder="请输入职务"
                :rules="[{ required: true, message: '请输入职务' }]" />
            <van-field readonly v-model="xzssjh" name="联系电话" label="联系电话" placeholder="请输入联系电话"
                :rules="[{ required: true, message: '请输入联系电话' }]" />
        </van-row>
        <van-row class="row" style="height: 177px;">
            <div class="mingz">口岸单位备案<span style="color:red;">(新备案公司须上传)</span></div>
            <van-col span="11">

                <div class="shangc" style="line-height: 140px;">
                    <van-uploader :after-read="afterRead4" :max-size="500 * 1024" multiple @oversize="onOversize">
                        <van-button icon="plus" style="height:80px;width:105px;"></van-button>
                    </van-uploader>
                </div>
            </van-col>

            <van-col span="2">
                <el-divider direction="vertical"></el-divider>
            </van-col>
            <van-col class="colee" span="11">
                <img v-if="imageUrl4" :src="imageUrl4" class="avatar" ref="imgsa4" @click="acs">
                <a class="aher" @click="cktp4">点击查看</a>
            </van-col>
            <span class="tsxx">可接受格式为：jpg、jpeg、png、gif、图片大小不能超过500k；可以添加水印，但不能遮挡关键信息。</span>
        </van-row>
        <van-row class="rows">
            <van-row class="annius">
                <div>附件1：2024年度公司和人员备案年审统计表</div>
                <van-row type="flex" justify="end">
                    <div style=" float: right;">
                        <van-uploader :after-read='afterReadfj1' :max-count="1" accept=".xlsx,.xls">
                            <van-button icon="plus" type="primary">上传文件</van-button>
                        </van-uploader>
                    </div>
                </van-row>

                <div style=" width: 100%;height: 100%;">
                    <img v-show="fjxsa1" src="@/assets/image/xsl.webp" alt="" class="fj" style="float: right;">
                </div>
            </van-row>
            <van-row class="annius">
                <div>附件2：2024年度备案人员增减统计表</div>
                <van-row type="flex" justify="end">
                    <div style=" float: right; margin-top:20px;">
                        <van-uploader :after-read='afterReadfj2' :max-count="1" accept=".xlsx,.xls">
                            <van-button icon="plus" type="primary">上传文件</van-button>
                        </van-uploader>
                    </div>
                </van-row>

                <div style=" width: 100%;height: 100%;">
                    <img v-show="fjxsa2" src="@/assets/image/xsl.webp" alt="" class="fj" style="float: right;">
                </div>
            </van-row>

        </van-row>
        <span class="tsxx" style="margin: 0px 10px 40px 10px;">可接受格式为：xlsx、xls、</span>



        <van-row class="anniu" type="flex" justify="center">
            <van-col span="12">
                <van-button type="default" @click="fanhui" block>返回</van-button>
            </van-col>
            <van-col span="12">
                <van-button type="info" block @click="glyrz" :disabled="zt='1'? false:true">提交</van-button>
            </van-col>
        </van-row>
        <van-dialog v-model="show" title="备案" show-cancel-button @close="close" @confirm="confirm">
            <span style="display: flex;align-items: center;justify-content: center;">确认是已备案公司并提交</span>
        </van-dialog>
    </div>
</template>

<script>
    import screenfull from 'screenfull';
    export default {
        data() {
            return {
                show: false,
                fjxsa1: false,
                fjxsa2: false,
                fj1: "",
                fj2: "",
                url: "http://58.59.43.168:8088/jeecg-boot/api/upload",
                zt: "1",
                // imageUrl: require('@/assets/image/aaa (1).png'),
                imageUrl: require('@/assets/image/zz.jpg'),
                imageUrl2: require('@/assets/image/zm.jpg'),
                imageUrl3: require('@/assets/image/fm.jpg'),
                imageUrl4: require('@/assets/image/kadwbab.png'),
                //申报口岸
                value: '',
                valuea: '',
                qymc: "",
                zzzz: "",
                sfza: "",
                sfzb: "",
                name: "",
                sfz: "",
                sysOrgCode: "",
                zw: "",
                lxdh: "",
                sqs: "",
                // columns: [],
                columns: [],
                columnsa: [],
                qydm: "",
                showPicker: false,
                showPickera: false,
                password: '',
                radio: '',
                xzsxm: "",
                xzssjh: "",
                xzssfz: "",
                kaid: "",
                kaida: "",
                xb: "",

            };
        },
        created() {
            var that = this
            that.kouanxx()
            that.qylx()
        },
        mounted() {
            var that = this
            var mx = window.sessionStorage.getItem("mz")
            var sjh = window.sessionStorage.getItem("sjh")
            var sfz = window.sessionStorage.getItem("sfz")
            var xb = window.sessionStorage.getItem("xb")
            if (xb == 1) {
                that.xb = "男"
            }
            if (xb == 2) {
                that.xb = "女"
            }
            that.name = mx
            that.sfz = sfz
            that.lxdh = sjh
            that.radio = xb
            // 须展示
            that.xzsxm = mx
            that.xzssjh = sjh
            that.xzssfz = sfz
            if (that.xzsxm.length == '2') {
                that.xzsxm = '*' + that.xzsxm.charAt(that.xzsxm.length - 1)
            }
            if (that.xzsxm.length == '3') {
                that.xzsxm = '**' + that.xzsxm.charAt(that.xzsxm.length - 1)
            }
            if (that.xzsxm.length == '4') {
                that.xzsxm = '***' + that.xzsxm.charAt(that.xzsxm.length - 1)
            }
            if (that.xzsxm.length == '5') {
                that.xzsxm = '****' + that.xzsxm.charAt(that.xzsxm.length - 1)
            }
            that.xzssjh = that.xzssjh.substr(0, 3) + '******' + that.xzssjh.substr(9, 2)
            // 15位身份证号
            if (that.xzssfz.length == '15') {
                that.xzssfz = that.xzssfz.substr(0, 1) + '*************' + that.xzssfz.substr(14, 1)
            }
            // 18位身份证号
            if (that.xzssfz.length == '18') {
                that.xzssfz = that.xzssfz.substr(0, 1) + '****************' + that.xzssfz.substr(17, 1)
            }
            console.log(that.xzssfz);
            console.log(that.xzssjh);
            console.log(that.xzsxm);

        },
        methods: {
            confirm() {
                var that = this
                // var zzzz = sessionStorage.getItem("zzzz")
                // var sfza = sessionStorage.getItem("sfza")
                // var sfzb = sessionStorage.getItem("sfzb")
                // var sqs = sessionStorage.getItem("sqs")
                that.$toast.loading({
                    message: '上传中...',
                    forbidClick: true,
                    duration: 50000,
                });
                var jmqsjtj = JSON.stringify({
                    //入参内容
                    "fj1": that.fj1,
                    "fj2": that.fj2,
                    "bm": "",
                    "code": that.qydm,
                    "createBy": "",
                    "createTime": "",
                    "id": "",
                    "lxdh": that.lxdh,
                    "name": "",
                    "phone": "",
                    "qymc": that.qymc,
                    "sbka": that.kaid,
                    "busType": that.kaida,
                    "sfz": that.sfz,
                    "sfza": that.sfza,
                    "sfzb": that.sfzb,
                    "sh": "",
                    "shxx": "",
                    "sqs": that.sqs,
                    "sysOrgCode": that.sysOrgCode,
                    "updateBy": "",
                    "updateTime": "",
                    "xb": that.xb,
                    "xm": that.name,
                    "zw": that.zw,
                    "zzzz": that.zzzz
                })
                var jmhsjtj = SM.encrypt(jmqsjtj,
                    //公钥
                    "047b1fd1a3edd93537a982a80747b1f16943dfba7c479d9af2b646daf609a119d9628676f8b20275e7ea017ec8119a7b70cea3f48f1bbad934c4d9c6c9a4666a00"
                );
                // var appid = that.appid;
                var appid = "Embmzckm";
                var interfaceid = 'qyglysq';
                var interfacecontent = jmhsjtj
                var fromport = '2';
                var signurl = 'https://' + urldomaincreatesign;
                var gatewayurl = 'https://' + urldomaingateway;
                vaildInterfacefn(appid, interfaceid, interfacecontent, fromport, signurl, gatewayurl).then(value => {
                        console.log(that.zzzz);
                        console.log(value);
                        //私钥
                        var jjjsjtj = SM.decrypt(value,
                            "6636756e69f8276c514919d04eaf928498b443bfb783e8fe6fa6977056c4d90b");
                        console.log(jjjsjtj);
                        console.log("口岸id", that.kaid);
                        var list = JSON.parse(jjjsjtj)
                        console.log(list);
                        that.zt = "2"
                        if (list.code == 200) {
                            that.$toast.clear();
                            that.zt = "1"
                            that.$toast('提交成功');
                            that.$router.push('./')

                        } else {
                            that.$toast("上传失败，请重新上传");
                        }
                        if (list.code == 500) {
                            that.$toast.clear();
                            that.$toast(list.message);
                        }

                    }

                )
            },
            // 弹框取消
            close() {
                console.log(456);
            },

            onOversize(file) {
                var that = this
                console.log(file);
                that.$toast("图片大小不得大于500k");
            },
            fanhui() {
                var that = this
                that.$router.push('./tjrz')
            },
            // 上传图片
            afterRead4(file) {
                var that = this
                if (that.qydm == "" || that.qydm == null || that.qydm == undefined) {
                    that.$toast("请先上传机构代码");
                    return
                }
                that.$toast.loading({
                    message: '上传中...',
                    forbidClick: true,
                    duration: 50000,
                });
                // // 参数
                console.log("123", file)
                that.imageUrl4 = file.content

                let headers = {
                    "mimeType": "multipart/form-data",
                };
                let requestData = {
                    "code": that.qydm,
                    "fn": "qygly_kadwba"
                }
                let ssss = JSON.stringify(requestData)
                var jmhsjtj = SM.encrypt(ssss,
                    "04c8a3f92811813de0fb7f4fac39a1ddcac65445770e593f89a337e2ba400cde970d4eafb556cda56bd6ad9f41a32f944653a9024fee28298b3aaafe90f0644f96"
                );
                let fdDqtq = new FormData()
                fdDqtq.append('app_id', "Embmzckm")
                fdDqtq.append('interface_id', 'tpscaa')
                fdDqtq.append('version', '1.0')
                fdDqtq.append('biz_content', jmhsjtj)
                fdDqtq.append('header', JSON.stringify(headers))
                fdDqtq.append('file', file.file)
                fdDqtq.append('charset', 'utf-8')
                fdDqtq.append('timestamp', (new Date()).valueOf())
                fdDqtq.append('origin', '2')
                fdDqtq.append('sign', 'signResult')
                $.ajax({
                    url: "https://isdapp.shandong.gov.cn/jpaas-jags-server/interface/gateway",
                    type: 'post',
                    dataType: 'json',
                    data: fdDqtq,
                    contentType: false,
                    processData: false,
                    cache: false,
                    success: function (data) {
                        console.log(data);
                        let response = JSON.parse(SM.decrypt(data.data,
                            "6636756e69f8276c514919d04eaf928498b443bfb783e8fe6fa6977056c4d90b"))
                        console.log(response);
                        that.sqs = response.result[0]
                        // window.sessionStorage.setItem("sqs", that.sqs)
                        // console.log("sqs", that.sqs);
                        console.log("爱山东");
                        that.$toast.clear();
                    },
                    error: function (data) {
                        console.log(data);
                        that.$toast("网络不稳定请重新上传");
                    }
                })
            },
            // 上传图片
            afterRead3(file) {
                var that = this
                if (that.qydm == "" || that.qydm == null || that.qydm == undefined) {
                    that.$toast("请先上传机构代码");
                    return
                }
                that.$toast.loading({
                    message: '上传中...',
                    forbidClick: true,
                    duration: 50000,
                });
                // // 参数
                console.log("123", file)
                that.imageUrl3 = file.content
                let headers = {
                    "mimeType": "multipart/form-data",
                };
                let requestData = {
                    "code": that.qydm,
                    "fn": "qygly_sfzfm"
                }
                let ssss = JSON.stringify(requestData)
                var jmhsjtj = SM.encrypt(ssss,
                    "04c8a3f92811813de0fb7f4fac39a1ddcac65445770e593f89a337e2ba400cde970d4eafb556cda56bd6ad9f41a32f944653a9024fee28298b3aaafe90f0644f96"
                );
                let fdDqtq = new FormData()
                fdDqtq.append('app_id', "Embmzckm")
                fdDqtq.append('interface_id', 'tpscaa')
                fdDqtq.append('version', '1.0')
                fdDqtq.append('biz_content', jmhsjtj)
                fdDqtq.append('header', JSON.stringify(headers))
                fdDqtq.append('file', file.file)
                fdDqtq.append('charset', 'utf-8')
                fdDqtq.append('timestamp', (new Date()).valueOf())
                fdDqtq.append('origin', '2')
                fdDqtq.append('sign', 'signResult')
                $.ajax({
                    url: "https://isdapp.shandong.gov.cn/jpaas-jags-server/interface/gateway",
                    type: 'post',
                    dataType: 'json',
                    data: fdDqtq,
                    contentType: false,
                    processData: false,
                    cache: false,
                    success: function (data) {
                        console.log(data);
                        let response = JSON.parse(SM.decrypt(data.data,
                            "6636756e69f8276c514919d04eaf928498b443bfb783e8fe6fa6977056c4d90b"))
                        console.log(response);
                        that.sfzb = response.result[0]
                        // window.sessionStorage.setItem("sfzb", that.sfzb)
                        // console.log("sqs", that.sfzb);
                        console.log("爱山东");
                        that.$toast.clear();
                    },
                    error: function (data) {
                        console.log(data);
                        that.$toast("网络不稳定请重新上传");
                    }
                })
            },
            // 上传图片
            afterRead2(file) {
                var that = this
                if (that.qydm == "" || that.qydm == null || that.qydm == undefined) {
                    that.$toast("请先上传机构代码");
                    return
                }
                that.$toast.loading({
                    message: '上传中...',
                    forbidClick: true,
                    duration: 50000,
                });
                // // 参数
                console.log("123", file)
                that.imageUrl2 = file.content
                let headers = {
                    "mimeType": "multipart/form-data",
                };
                let requestData = {
                    "code": that.qydm,
                    "fn": "qygly_sfzzm"
                }
                let ssss = JSON.stringify(requestData)
                var jmhsjtj = SM.encrypt(ssss,
                    "04c8a3f92811813de0fb7f4fac39a1ddcac65445770e593f89a337e2ba400cde970d4eafb556cda56bd6ad9f41a32f944653a9024fee28298b3aaafe90f0644f96"
                );
                let fdDqtq = new FormData()
                fdDqtq.append('app_id', "Embmzckm")
                fdDqtq.append('interface_id', 'tpscaa')
                fdDqtq.append('version', '1.0')
                fdDqtq.append('biz_content', jmhsjtj)
                fdDqtq.append('header', JSON.stringify(headers))
                fdDqtq.append('file', file.file)
                fdDqtq.append('charset', 'utf-8')
                fdDqtq.append('timestamp', (new Date()).valueOf())
                fdDqtq.append('origin', '2')
                fdDqtq.append('sign', 'signResult')
                $.ajax({
                    url: "https://isdapp.shandong.gov.cn/jpaas-jags-server/interface/gateway",
                    type: 'post',
                    dataType: 'json',
                    data: fdDqtq,
                    contentType: false,
                    processData: false,
                    cache: false,
                    success: function (data) {
                        console.log(data);
                        let response = JSON.parse(SM.decrypt(data.data,
                            "6636756e69f8276c514919d04eaf928498b443bfb783e8fe6fa6977056c4d90b"))
                        console.log(response);
                        that.sfza = response.result[0]
                        // window.sessionStorage.setItem("sfza", that.sfza)
                        // console.log("sqs", that.sfza);
                        console.log("爱山东");
                        that.$toast.clear();
                    },
                    error: function (data) {
                        console.log(data);
                        that.$toast("网络不稳定请重新上传");
                    }
                })
            },
            // 上传图片
            afterRead(file) {
                var that = this
                if (that.qydm == "" || that.qydm == null || that.qydm == undefined) {
                    that.$toast("请先上传机构代码");
                    return
                }
                that.$toast.loading({
                    message: '上传中...',
                    forbidClick: true,
                    duration: 50000,
                });
                // // 参数
                console.log("123", file)
                that.imageUrl = file.content
                let headers = {
                    "mimeType": "multipart/form-data",
                };
                let requestData = {
                    "code": that.qydm,
                    "fn": "qygly_zzzz"
                }
                let ssss = JSON.stringify(requestData)
                var jmhsjtj = SM.encrypt(ssss,
                    "04c8a3f92811813de0fb7f4fac39a1ddcac65445770e593f89a337e2ba400cde970d4eafb556cda56bd6ad9f41a32f944653a9024fee28298b3aaafe90f0644f96"
                );
                let fdDqtq = new FormData()
                fdDqtq.append('app_id', "Embmzckm")
                fdDqtq.append('interface_id', 'tpscaa')
                fdDqtq.append('version', '1.0')
                fdDqtq.append('biz_content', jmhsjtj)
                fdDqtq.append('header', JSON.stringify(headers))
                fdDqtq.append('file', file.file)
                fdDqtq.append('charset', 'utf-8')
                fdDqtq.append('timestamp', (new Date()).valueOf())
                fdDqtq.append('origin', '2')
                fdDqtq.append('sign', 'signResult')
                $.ajax({
                    url: "https://isdapp.shandong.gov.cn/jpaas-jags-server/interface/gateway",
                    type: 'post',
                    dataType: 'json',
                    data: fdDqtq,
                    contentType: false,
                    processData: false,
                    cache: false,
                    success: function (data) {
                        console.log(data);
                        let response = JSON.parse(SM.decrypt(data.data,
                            "6636756e69f8276c514919d04eaf928498b443bfb783e8fe6fa6977056c4d90b"))
                        console.log(response);
                        that.zzzz = response.result[0]
                        // window.sessionStorage.setItem("zzzz", that.zzzz)
                        // console.log("sqs", that.zzzz);
                        that.$toast.clear();
                        console.log("爱山东");
                        console.log(that.qydm);
                    },
                    error: function (data) {
                        console.log(data);
                        that.$toast("网络不稳定请重新上传");

                    }
                })
            },
            // 附件1
            afterReadfj1(file) {
                var that = this
                if (that.qydm == "" || that.qydm == null || that.qydm == undefined) {
                    that.$toast("请先上传机构代码");
                    return
                }
                that.$toast.loading({
                    message: '上传中...',
                    forbidClick: true,
                    duration: 50000,
                });
                // // 参数
                console.log(file.content);
                let headers = {
                    "mimeType": "multipart/form-data",
                };
                let requestData = {
                    "code": that.qydm,
                    "fn": "qygly_fj1"
                }
                let ssss = JSON.stringify(requestData)
                var jmhsjtj = SM.encrypt(ssss,
                    "04c8a3f92811813de0fb7f4fac39a1ddcac65445770e593f89a337e2ba400cde970d4eafb556cda56bd6ad9f41a32f944653a9024fee28298b3aaafe90f0644f96"
                );
                let fdDqtq = new FormData()
                fdDqtq.append('app_id', "Embmzckm")
                fdDqtq.append('interface_id', 'tpscaa')
                fdDqtq.append('version', '1.0')
                fdDqtq.append('biz_content', jmhsjtj)
                fdDqtq.append('header', JSON.stringify(headers))
                fdDqtq.append('file', file.file)
                fdDqtq.append('charset', 'utf-8')
                fdDqtq.append('timestamp', (new Date()).valueOf())
                fdDqtq.append('origin', '2')
                fdDqtq.append('sign', 'signResult')
                $.ajax({
                    url: "https://isdapp.shandong.gov.cn/jpaas-jags-server/interface/gateway",
                    type: 'post',
                    dataType: 'json',
                    data: fdDqtq,
                    contentType: false,
                    processData: false,
                    cache: false,
                    success: function (data) {
                        console.log(data);
                        let response = JSON.parse(SM.decrypt(data.data,
                            "6636756e69f8276c514919d04eaf928498b443bfb783e8fe6fa6977056c4d90b"))
                        console.log(response);
                        if (response.code == 200) {
                            that.fj1 = response.result[0]
                            that.$toast.clear();
                            that.$toast('上传成功');
                            that.fjxsa1 = true
                        } else {
                            that.$toast("上传失败，请重新上传");
                        }
                    },
                    error: function (data) {
                        console.log(data);
                        that.$toast("网络不稳定请重新上传");
                    }
                })
            },
            // 附件2
            afterReadfj2(file) {
                var that = this
                if (that.qydm == "" || that.qydm == null || that.qydm == undefined) {
                    that.$toast("请先上传机构代码");
                    return
                }
                that.$toast.loading({
                    message: '上传中...',
                    forbidClick: true,
                    duration: 50000,
                });
                console.log(file.content);
                let headers = {
                    "mimeType": "multipart/form-data",
                };
                let requestData = {
                    "code": that.qydm,
                    "fn": "qygly_fj2"
                }
                let ssss = JSON.stringify(requestData)
                var jmhsjtj = SM.encrypt(ssss,
                    "04c8a3f92811813de0fb7f4fac39a1ddcac65445770e593f89a337e2ba400cde970d4eafb556cda56bd6ad9f41a32f944653a9024fee28298b3aaafe90f0644f96"
                );
                let fdDqtq = new FormData()
                fdDqtq.append('app_id', "Embmzckm")
                fdDqtq.append('interface_id', 'tpscaa')
                fdDqtq.append('version', '1.0')
                fdDqtq.append('biz_content', jmhsjtj)
                fdDqtq.append('header', JSON.stringify(headers))
                fdDqtq.append('file', file.file)
                fdDqtq.append('charset', 'utf-8')
                fdDqtq.append('timestamp', (new Date()).valueOf())
                fdDqtq.append('origin', '2')
                fdDqtq.append('sign', 'signResult')
                $.ajax({
                    url: "https://isdapp.shandong.gov.cn/jpaas-jags-server/interface/gateway",
                    type: 'post',
                    dataType: 'json',
                    data: fdDqtq,
                    contentType: false,
                    processData: false,
                    cache: false,
                    success: function (data) {
                        console.log(data);
                        let response = JSON.parse(SM.decrypt(data.data,
                            "6636756e69f8276c514919d04eaf928498b443bfb783e8fe6fa6977056c4d90b"))
                        console.log(response);
                        if (response.code == 200) {
                            that.fj2 = response.result[0]
                            that.$toast.clear();
                            that.$toast('上传成功');
                            that.fjxsa2 = true
                        } else {
                            that.$toast("上传失败，请重新上传");
                        }
                    },
                    error: function (data) {
                        console.log(data);
                        that.$toast("网络不稳定请重新上传");
                    }
                })
            },
            cktp() {
                var that = this
                // that.$refs.imgsa.innerHTML
                if (screenfull.isEnabled) {
                    screenfull.toggle(that.$refs.imgsa);
                } else {
                    that.$toast('ios暂不支持放大效果');
                }
            },
            cktp2() {
                var that = this
                // that.$refs.imgsa.innerHTML
                if (screenfull.isEnabled) {
                    screenfull.toggle(that.$refs.imgsa2);
                } else {
                    that.$toast('ios暂不支持放大效果');
                }
            },
            cktp3() {
                var that = this
                // that.$refs.imgsa.innerHTML
                if (screenfull.isEnabled) {
                    screenfull.toggle(that.$refs.imgsa3);
                } else {
                    that.$toast('ios暂不支持放大效果');
                }
            },
            cktp4() {
                var that = this
                // that.$refs.imgsa.innerHTML
                if (screenfull.isEnabled) {
                    screenfull.toggle(that.$refs.imgsa4);
                } else {
                    that.$toast('ios暂不支持放大效果');
                }
            },
            acs() {
                console.log(123);
                // screenfull.toggle()
            },
            onConfirm(value) {
                var that = this
                that.value = value.name;
                that.kaid = value.id;
                console.log(that.value);
                console.log(that.kaid);
                that.showPicker = false;
            },
            onConfirma(valuea) {
                console.log(valuea);
                var that = this
                that.valuea = valuea.name;
                that.kaida = valuea.id;
                console.log(that.valuea);
                console.log(that.kaida);
                that.showPickera = false;
            },
            onSubmit(values) {
                console.log('submit', values);
            },
            kouanxx() {
                var that = this
                var jmqsjtj = JSON.stringify({
                    //入参内容
                })
                var jmhsjtj = SM.encrypt(jmqsjtj,
                    //公钥
                    "04f82fca5663e92a3830c8bdab96a9383a83610bb793da146ea4dfbb4035690c36bf7816aa00cd57d9df96b35d4286b75d8a7c2210300f4d70899a08ea0357a692"
                );
                // var appid = that.appid;
                var appid = "Embmzckm";
                var interfaceid = 'hqkalb';
                var interfacecontent = jmhsjtj
                var fromport = '2';
                var signurl = 'https://' + urldomaincreatesign;
                var gatewayurl = 'https://' + urldomaingateway;
                vaildInterfacefn(appid, interfaceid, interfacecontent, fromport, signurl, gatewayurl).then(value => {
                    //私钥
                    var jjjsjtj = SM.decrypt(value,
                        "6636756e69f8276c514919d04eaf928498b443bfb783e8fe6fa6977056c4d90b");
                    var list = JSON.parse(jjjsjtj)
                    that.kaid = list.result.id
                    that.columns = list.result
                })

            },
            qylx() {
                var that = this
                var jmqsjtj = JSON.stringify({
                    //入参内容
                })
                var jmhsjtj = SM.encrypt(jmqsjtj,
                    //公钥
                    "04bbc30dfb0971796ddf99ddcf35810b2f9e167ad540182337f4c4ae8f7101ef01e85017a275147d0834154701345b862a810477ab3b111b17a22d4c5380c60750"
                );
                // var appid = that.appid;
                var appid = "Embmzckm";
                var interfaceid = 'qylx';
                var interfacecontent = jmhsjtj
                var fromport = '2';
                var signurl = 'https://' + urldomaincreatesign;
                var gatewayurl = 'https://' + urldomaingateway;
                vaildInterfacefn(appid, interfaceid, interfacecontent, fromport, signurl, gatewayurl).then(value => {
                    //私钥
                    var jjjsjtj = SM.decrypt(value,
                        "6636756e69f8276c514919d04eaf928498b443bfb783e8fe6fa6977056c4d90b");
                    var list = JSON.parse(jjjsjtj)
                    that.kaida = list.result.id
                    that.columnsa = list.result
                })

            },
            // 提交管理员认证表单
            glyrz() {
                var that = this
                if (that.zzzz == "" || that.zzzz == null) {
                    that.$toast("请上传组织证照")
                    return
                }
                if (that.value == "") {
                    that.$toast("申报口岸不能为空")
                    return
                }
                if (that.valuea == "") {
                    that.$toast("企业类型不能为空")
                    return
                }
                if (that.qymc == "") {
                    that.$toast("企业名称不能为空")
                    return
                }
                if (that.jgdm == "") {
                    that.$toast("机构代码不能为空")
                    return
                }
                if (that.sfza == "" || that.sfza == null) {
                    that.$toast("请上传身份证（正面）")
                    return
                }
                if (that.sfzb == "" || that.sfzb == null) {
                    that.$toast("请上传身份证（反面）")
                    return
                }
                if (that.sysOrgCode == "") {
                    that.$toast("所属部门不能为空")
                    return
                }
                if (that.zw == "") {
                    that.$toast("职务不能为空")
                    return
                }
                if (that.fj1 == "" || that.fj1 == null) {
                    that.$toast("请上传附件1")
                    return
                }
                if (that.fj2 == "" || that.fj2 == null) {
                    that.$toast("请上传附件2")
                    return
                }
                if (that.sqs == "" || that.sqs == null) {
                    that.show = true
                } else {
                    // var zzzz = sessionStorage.getItem("zzzz")
                    // var sfza = sessionStorage.getItem("sfza")
                    // var sfzb = sessionStorage.getItem("sfzb")
                    // var sqs = sessionStorage.getItem("sqs")
                    that.$toast.loading({
                        message: '上传中...',
                        forbidClick: true,
                        duration: 50000,
                    });
                    var jmqsjtj = JSON.stringify({
                        //入参内容
                        "fj1": that.fj1,
                        "fj2": that.fj2,
                        "bm": "",
                        "code": that.qydm,
                        "createBy": "",
                        "createTime": "",
                        "id": "",
                        "lxdh": that.lxdh,
                        "name": "",
                        "phone": "",
                        "qymc": that.qymc,
                        "sbka": that.kaid,
                        "busType": that.kaida,
                        "sfz": that.sfz,
                        "sfza": that.sfza,
                        "sfzb": that.sfzb,
                        "sh": "",
                        "shxx": "",
                        "sqs": that.sqs,
                        "sysOrgCode": that.sysOrgCode,
                        "updateBy": "",
                        "updateTime": "",
                        "xb": that.xb,
                        "xm": that.name,
                        "zw": that.zw,
                        "zzzz": that.zzzz
                    })
                    var jmhsjtj = SM.encrypt(jmqsjtj,
                        //公钥
                        "047b1fd1a3edd93537a982a80747b1f16943dfba7c479d9af2b646daf609a119d9628676f8b20275e7ea017ec8119a7b70cea3f48f1bbad934c4d9c6c9a4666a00"
                    );
                    // var appid = that.appid;
                    var appid = "Embmzckm";
                    var interfaceid = 'qyglysq';
                    var interfacecontent = jmhsjtj
                    var fromport = '2';
                    var signurl = 'https://' + urldomaincreatesign;
                    var gatewayurl = 'https://' + urldomaingateway;
                    vaildInterfacefn(appid, interfaceid, interfacecontent, fromport, signurl, gatewayurl).then(
                        value => {
                            console.log(that.zzzz);
                            console.log(value);
                            //私钥
                            var jjjsjtj = SM.decrypt(value,
                                "6636756e69f8276c514919d04eaf928498b443bfb783e8fe6fa6977056c4d90b");
                            console.log(jjjsjtj);
                            console.log("口岸id", that.kaid);
                            var list = JSON.parse(jjjsjtj)
                            console.log(list);
                            that.zt = "2"
                            if (list.code == 200) {
                                that.$toast.clear();
                                that.zt = "1"
                                that.$toast('提交成功');
                                that.$router.push('./')

                            } else {
                                that.$toast("上传失败，请重新上传");
                            }
                            if (list.code == 500) {
                                that.$toast.clear();
                                that.$toast(list.message);
                            }

                        }

                    )
                }
            }
        }
    }
</script>


<style scoped lang="less">
    // .van-button__icon {
    //     margin-top: -10px;
    // }

    // .van-button--normal {
    //     padding: 11px 15px 0 15px;
    // }
    .fj {
        display: block;
        width: 31.5%;
        height: 31.5%;
        margin: 15px 5px 0 0px;
    }

    .van-cell__value--alone {
        font-weight: 600;
        font-size: 23px;
    }

    .van-cell {
        font-size: 18px;
    }

    .biaodanm {
        padding-bottom: 15px;
    }

    .van-divider::before {
        display: none;
    }

    .anniu {
        padding: 35px 10px 35px 10px;
    }

    .annius {
        padding: 35px 10px 3px 10px;
    }

    .van-cell[data-v-2a6871e3] {
        padding: 16px 16px;
    }

    .box {
        background-color: #e0e0e023;
    }

    .tsxx {
        width: 90%;
        font-size: 12px;
        font-variant-caps: all-small-caps;
        color: #f3d87d;
    }

    .el-divider--vertical {
        height: 6em;
        top: 15%;
    }

    .van-cell {
        padding: 12px 16px;
    }

    .row {
        height: 140px;
        // line-height: 140px;
        background-color: #F4F9FF;
        margin: 0px 10px 40px 10px;

        .mingz {
            height: 40px;
            width: 90%;
            font-weight: 500;
            font-size: 20px;
            display: flex;
            align-items: center;
            margin-left: auto;
            // line-height: 30px;
        }

        .shangc {
            height: 100px;
            line-height: 90px;
        }

        .van-col {
            height: 140px;
            // line-height: 140px;
            text-align: center;

            .avatar-uploader {
                height: 100px !important;
                line-height: 94px;
            }
        }
    }

    .rows {
        height: 100%;
        // line-height: 140px;
        background-color: #F4F9FF;
        margin: 0px 10px 0px 10px;
        padding: 0 0 35px 0;

        .mingz {
            height: 40px;
            width: 90%;
            font-weight: 500;
            font-size: 20px;
            display: flex;
            align-items: center;
            margin-left: auto;
            // line-height: 30px;
        }

        .shangc {
            height: 100px;
            line-height: 90px;
        }

        .van-col {
            height: 140px;
            // line-height: 140px;
            text-align: center;

            .avatar-uploader {
                height: 100px !important;
                line-height: 94px;
            }
        }
    }

    .avatar-uploader .el-upload {
        border: 1px dashed #d9d9d9;
        border-radius: 6px;
        cursor: pointer;
        position: relative;
        overflow: hidden;
    }


    .avatar-uploader-icon {
        // font-size: 28px;
        background-color: #ffffff;
        color: #8c939d;
        width: 105px;
        height: 80px;
        line-height: 80px;
        text-align: center;
    }

    .colee {
        // display: flex;
        // justify-content: center;
        // align-items: center;
        position: relative;

        .avatar {
            width: 60px;
            height: 40px;
            display: block;
            // margin: 0 auto;
            position: absolute;
            top: 55%;
            left: 50%;
            transform: translate(-50%, -50%);
        }

        .aher {
            width: 60px;
            height: 40px;
            display: block;
            color: #008cff;
            font-size: 14px;
            // margin: 0 auto;
            position: absolute;
            top: 85%;
            left: 50%;
            transform: translate(-50%, -50%);
        }
    }
</style>